home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
pibsigs.zip
/
CDNORM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-04
|
2KB
|
39 lines
(*-------------------------------------------------------------------------*)
(* CDNorm -- Cumulative normal distribution probability *)
(*-------------------------------------------------------------------------*)
FUNCTION CDNorm( X : REAL ) : REAL;
(*-------------------------------------------------------------------------*)
(* *)
(* Function: CDNorm *)
(* *)
(* Purpose: Evaluates cumulative normal distribution probability *)
(* *)
(* Calling Sequence: *)
(* *)
(* P := CDNorm( X ); *)
(* *)
(* X --- ordinate of normal distribution *)
(* *)
(* P --- Resultant cumulative probability *)
(* *)
(* Calls: *)
(* *)
(* Erf *)
(* *)
(* Method: *)
(* *)
(* The simple relationship between the error function and the *)
(* normal distribution is used. *)
(* *)
(*-------------------------------------------------------------------------*)
BEGIN (* CDNorm *)
IF X >= 0.0 THEN
CDNorm := ( 1.0 + Erf( X / Sqrt2 ) ) / 2.0
ELSE
CDNorm := ( 1.0 - Erf( -X / Sqrt2 ) ) / 2.0;
END (* CDNorm *);